<template>
  <el-dialog title="查看" :visible.sync="dialogVisible" width="40%" class="popup" :before-close="handleClose">
    <el-form ref="ruleForm" :model="ruleForm" status-icon :rules="rules" label-width="110px" class="demo-ruleForm">
      <el-form-item label="任务编号" prop="pass">
        <el-input v-model="ruleForm.pass" type="password" autocomplete="off" />
      </el-form-item>
      <el-form-item label="任务名称" prop="pass">
        <el-input v-model="ruleForm.pass" type="password" autocomplete="off" />
      </el-form-item>
      <el-form-item label="任务内容" prop="pass">
        <el-input v-model="ruleForm.age" type="textarea" />
      </el-form-item>
      <el-form-item label="计划开始时间" prop="checkPass">
        <el-time-select placeholder="起始时间" v-model="startTime" :picker-options="{
      start: '08:30',
      step: '00:15',
      end: '18:30'
    }">
        </el-time-select>
      </el-form-item>
      <el-form-item label="计划完成时间" prop="age">
        <el-time-select placeholder="结束时间" v-model="endTime" :picker-options="{
      start: '08:30',
      step: '00:15',
      end: '18:30',
      minTime: startTime
    }">
        </el-time-select>
      </el-form-item>
    </el-form>
    <el-divider content-position="left">数据列表</el-divider>
    <el-table :data="tableData" height="250" border style="width: 100%">
      <el-table-column prop="date" label="执行日期" width="250">
      </el-table-column>
      <el-table-column prop="name" label="执行状态" width="250">
      </el-table-column>
      <el-table-column label="操作" align="center" width="200">
        <template slot-scope="scope">
          <el-button size="mini" type="primary" icon="el-icon-search" plain @click="handleSeesdialog(scope.$index, scope.row)">查看</el-button>
        </template>
      </el-table-column>
    </el-table>
    <span slot="footer" class="dialog-footer">
      <el-button size="small" @click="dialogVisible = false">取 消</el-button>
      <el-button type="primary" size="small" @click="dialogVisible = false">确 定</el-button>
    </span>
    <!-- 弹窗组件 -->
    <SeesDialog ref="seesdialog" />
  </el-dialog>

</template>

<script>
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
import SeesDialog from './seesdialog.vue'
export default {
  components: {
    SeesDialog
  },
  data () {
    return {
      dialogVisible: false,
      ruleForm: {
        pass: '',
        checkPass: '',
        age: ''
      },
      tableData: [{
        date: '2016-05-03',
        name: '王小虎',
        address: '上海市普陀区金沙江路 1518 弄'
      }, {
        date: '2016-05-02',
        name: '王小虎',
        address: '上海市普陀区金沙江路 1518 弄'
      }, {
        date: '2016-05-04',
        name: '王小虎',
        address: '上海市普陀区金沙江路 1518 弄'
      }, {
        date: '2016-05-01',
        name: '王小虎',
        address: '上海市普陀区金沙江路 1518 弄'
      }, {
        date: '2016-05-08',
        name: '王小虎',
        address: '上海市普陀区金沙江路 1518 弄'
      }, {
        date: '2016-05-06',
        name: '王小虎',
        address: '上海市普陀区金沙江路 1518 弄'
      }, {
        date: '2016-05-07',
        name: '王小虎',
        address: '上海市普陀区金沙江路 1518 弄'
      }],
      value: null,
      // define options
      options: [{
        id: 'a',
        label: 'a',
        children: [{
          id: 'aa',
          label: 'aa',
        }, {
          id: 'ab',
          label: 'ab',
        }],
      }, {
        id: 'b',
        label: 'b',
      }, {
        id: 'c',
        label: 'c',
      }],
    }
  },
  computed: {
    rules () {
      return {
        pass: [
          { required: true, message: '请输入活动名称', trigger: 'blur' },
        ],
        checkPass: [
          { required: true, message: '请输入活动名称', trigger: 'blur' },
        ],
        age: [
          { required: true, message: '请输入活动名称', trigger: 'blur' },
        ]
      }
    }

  },
  methods: {
    togglePopup (flag) {
      this.dialogVisible = flag
    },
    handleSeesdialog () {
      this.$refs.seesdialog.toggleseesdialog(true)
    },
    handleClose (done) {
      this.$confirm('确认关闭？')
        .then(_ => {
          done()
        })
        .catch(_ => { })
    }
  }
};
</script>

<style lang="scss" scoped>
.popup {
  ::v-deep .el-dialog {
    border-radius: 4px;
  }
  ::v-deep .el-dialog__header {
    border-bottom: 1px solid #cdd0db;
  }
  ::v-deep .el-dialog__body {
    padding: 30px;
  }
}
</style>

